import json


from api.base_service import BaseService


class UserService(BaseService):

    def __init__(self):
        super().__init__()

    def find_by_username(self, username):
        # 发送请求
        resp = self.dubbo_client.invoke("UserService", "findByUsername", username)
        # 将字符串转换 json
        resp = json.loads(resp)
        return resp

if __name__ == '__main__':
    us = UserService()
    result = us.find_by_username(1113)
    print(result)
    print(type(result))